on clicked theObject
	call method "makeKeyAndOrderFront:" of window "Imagem"
	tell user defaults
		set theDatabaseFinal to contents of default entry "theDatabaseFinal"
	end tell
	try
		set nObra to get contents of text field "nObra" of window "Prepress Ver Obras"
		set theDatabase to space & theDatabaseFinal & space
		set theDatabase to "sqlite3" & theDatabase & quote
		set getImage to "select pathImagem from prepress where nObra='" & nObra & "';"
		set theImage to (do shell script theDatabase & getImage & quote)
		set theImage to theImage as alias
		set image of image view "fullSizeImagem" of window "Imagem" to load image theImage
	on error
		set image of image view "fullSizeImagem" of window "Imagem" to load image "nopreview.png"
	end try
end clicked

on will close theObject
	set image of image view "fullSizeImagem" of window "Imagem" to load image "nopreview.png"
end will close
